package MovieGuessingGame.confirmRegistration;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JButton;
import javax.swing.JTextField;
import javax.swing.JPasswordField;

public class ConfirmRegistrationJPanel extends JPanel {

	JTextField userNameField;
	JTextField regCodeField;
	
	public String getUserName() {
		return userNameField.getText();
	}
	
	public String getRegCodeField() {
		return regCodeField.getText();
	}
	
	public String getPassword() {
		return passwordField.getText();
	}
	
	JPasswordField passwordField;
	JButton btnNewButton = null;
	JTextField messageField;

	public String getMessageFieldText() {
		return messageField.getText();
	}
	public void setMessageFieldText(String text) {
		this.messageField.setText(text);
		messageField.updateUI();
		this.repaint();
		this.setVisible(true);
		System.out.println("setMessageFieldText" + text);
	}
	/**
	 * Create the panel.
	 */
	public ConfirmRegistrationJPanel() {
		setLayout(null);
		
		JLabel lblConfirmRegistration = new JLabel("Confirm Registration and Set Password");
		// x, y, w, h
		lblConfirmRegistration.setBounds(135, 47, 225, 16);
		add(lblConfirmRegistration);
		
		JLabel lblNewLabel = new JLabel("User Name");
		lblNewLabel.setBounds(64, 119, 120, 16);
		add(lblNewLabel);
		
		userNameField = new JTextField();
		userNameField.setBounds(190, 116, 175, 22);
		add(userNameField);
		userNameField.setColumns(10);
		
		JLabel lblNewRegLabel = new JLabel("Registration Code");
		lblNewRegLabel.setBounds(64, 148, 120, 16);
		add(lblNewRegLabel);
		
		regCodeField = new JTextField();
		regCodeField.setBounds(190, 145, 175, 22);
		add(regCodeField);
		regCodeField.setColumns(10);

		JLabel lblNewLabel_1 = new JLabel("New Password");
		lblNewLabel_1.setBounds(64, 177, 120, 16);
		add(lblNewLabel_1);
		
		passwordField = new JPasswordField();
		passwordField.setBounds(190, 174, 175, 22);
		add(passwordField);
		
		JLabel lblNewLabel_2 = new JLabel("Return Code");
		lblNewLabel_2.setBounds(64, 210, 120, 16);
		add(lblNewLabel_2);
		
		messageField = new JTextField();
		messageField.setBounds(190, 210, 175, 22);
		add(messageField);
		messageField.setColumns(10);
		
		btnNewButton = new JButton("Submit");
		btnNewButton.setBounds(190, 250, 97, 25);
		add(btnNewButton);
	}
	
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		ConfirmRegistrationJPanel confWindow = new ConfirmRegistrationJPanel();
		JFrame frame = new JFrame();
		frame.getContentPane().add(confWindow);

		frame.setSize(500, 400);
		confWindow.setVisible(true);
		frame.setVisible(true);
	}

}
